@extends('admin::layouts.master')
@section('title')
    邀请列表
@endsection
@section('tab')

    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body ">
                        <form class="layui-form layui-col-space5" id="form1">

                            <div class="layui-input-inline layui-show-xs-block">
                                <select name="type">
                                    <option value="">申请类型</option>
                                    <option value="1" @if($arr_search['type']==1) selected @endif>个人</option>
                                    <option value="2" @if($arr_search['type']==2) selected @endif>企业</option>
                                </select>
                            </div>
                            <div class="layui-input-inline layui-show-xs-block">
                                <select name="cate">
                                    <option value="">申请方式</option>
                                    <option value="1" @if($arr_search['cate']==1) selected @endif>电子版</option>
                                    <option value="2" @if($arr_search['cate']==2) selected @endif>纸质版</option>
                                </select>
                            </div>
                            <div class="layui-input-inline layui-show-xs-block">
                                <select name="shenqin_status">
                                    <option value="">开票状态</option>
                                    <option value="1" @if($arr_search['shenqin_status']==1) selected @endif>待开发票</option>
                                    <option value="2" @if($arr_search['shenqin_status']==2) selected @endif>已开发票</option>
                                    <option value="3" @if($arr_search['shenqin_status']==3) selected @endif>拒绝开票</option>
                                </select>
                            </div>

                            <div class="layui-input-inline layui-show-xs-block">
                                <button class="layui-btn" lay-submit="" lay-filter="sreach">
                                    <i class="layui-icon">&#xe615;</i>
                                </button>
                                <a class="layui-btn layui-btn-small" onclick="location.reload()" title="刷新">
                                    <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
                                </a>
                            </div>
                        </form>
                    </div>
                    <div class="layui-card-body layui_overflow_y ">
                        <table class="layui-table layui-form">
                            <thead>
                            <tr>
                                <th>编号</th>
                                <th>用户头像</th>
                                <th>用户名称</th>
                                <th>申请类型</th>
                                <th>申请方式</th>
                                <th>申请时间</th>
                                <th>订单数量</th>
                                <th>开票张量</th>
                                <th>开票状态</th>
                                <th>开票说明</th>
                                <th>处理时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($data as $key=>$value)
                                <tr>
                                    <td>{{ $value['id'] }}</td>
                                    <td><img src="{{$value['user']['head_img']['full_src']}}" style="width: 80px; height: 80px;"></td>
                                    <td>{{ $value['user']['nickname'] }}</td>
                                    <td>{{ $value['type']['name'] }}</td>
                                    <td>{{ $value['cate']['name'] }}</td>
                                    <td>{{ $value['created_at'] }}</td>
                                    <td>{{  $value['all'] }} </td>
                                    <td>{{  $value['number'] }} </td>
                                    <td>
                                        @if( $value['shenqin_status'] == 1 )
                                            待开票
                                        @elseif( $value['shenqin_status'] == 2 )
                                            已开发票
                                        @else
                                            开票失败
                                        @endif
                                    </td>
                                    <td>{{ $value['content'] }}</td>
                                    <td>
                                        @if( $value['shenqin_status'] == 1)
                                            -
                                        @else
                                            {{ $value['updated_at'] }}
                                        @endif
                                    </td>
                                    <td>
                                        <a title="详情" class="layui-btn layui-btn-primary" onclick="xadmin.open('详情','{{route('shop_invoice_detail',['id'=>$value['id']])}}',$(window).width(),$(window).height())" href="javascript:;">详情</a>
                                    </td>
                                </tr>
                            @endforeach
                            @if(empty($data))
                                <td colspan="12" align="center">暂无数据</td>
                            @endif
                            </tbody>
                        </table>
                    </div>
                    <div class="layui-card-body ">
                        <div class="page">
                            {{$page_link}}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

@endsection


@section('tab_js')
    <script>
        layui.use(['form', 'layer', 'jquery'], function () {
        $ = layui.jquery;
        var form = layui.form,
            layer = layui.layer;

            $(".click_a").click(function(){
                var user_id = $(this).attr('data-id');
                $("input[name='user_id']").val( user_id );
                $("input[name='name']").val( $(this).text() );
                $("#form1").submit();
            })
        })
    </script>
@endsection




